#include <stdio.h>
#include "StudentMain.h"

void UpdataStudent(node* head)
{
	int Upid;	
	printf("\n欢迎来到修改模式!\n");
	printf("请输入您想修改学生的学号:>");
	scanf("%d", &Upid);
	
	node* pnode = NodeFind(head, Upid);
	if(pnode == NULL)
	{
		printf("\n没有该学生信息!\n");
	}
	else
	{
		node* A = pnode;
		printf("\n请根据提示输入修改后的人员信息!\n");
        	printf("\n学生学号:>");
        	scanf("%d", &A->data->id);
        	printf("\n学生年龄:>");
        	scanf("%d", &A->data->age);
        	printf("\nC语言成绩:>");
        	scanf("%d",&A->data->program);
        	while(A->data->program < 0)
        	{       
                	//判断成绩是否小于0
                	printf("\n输入成绩有误！请重新输入！\n");
               		scanf("%d", &A->data->program);
                }
                printf("\n学生姓名:>");
                scanf("%s", A->data->name);
                printf("\n学生性别:>");
                scanf("%s", A->data->sex);
		
		printf("\n修改成功！\n");
	}
}


